package com.zc.controller.center;

import com.zc.pojo.Users;
import com.zc.service.center.CenterUserService;
import com.zc.utils.JSONResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author 曾川
 * @version 1.0.0
 * @ClassName CentetController.java
 * @Description TODO
 * @createTime 2021年08月04日 10:26:00
 */
@Api(value = "center - 用户中心", tags = {"用户中心展示的相关接口"})
@RestController
@RequestMapping("center")
public class CenterController {

    @Autowired
    private CenterUserService centerUserService;


    @ApiOperation(value = "获取用户信息", notes = "获取用户信息", httpMethod = "GET")
    @GetMapping("userInfo")
    public JSONResult userInfo(
            @ApiParam(name = "userId", value = "用户Id", required = true)
            @RequestParam String userId) {
        Users users = centerUserService.queryUserInfo(userId);
        return JSONResult.ok(users);
    }
}
